package per.wxp.eureka_ribbon;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;


@Service
public class IndexService {

	@Autowired
	RestTemplate restTemplate;
	
	
	@HystrixCommand(fallbackMethod="helloFallback")
	public String helloService(){
		return restTemplate.getForEntity("http://compute-service/string", String.class).getBody();
		
	}
	
	public String helloFallback(){
		return "error";
	}
}
